#include<iostream>
#include<string>
using namespace std;
const int N = 1e5 + 10;
int a[N],b,c[N];
typedef long long LL;
int main()
{
	string s1,s2;cin >> s1 >> b;
	int la = s1.size();
	int lc = la;
	LL t;
	for(int i = 0 ; i < la; i++)
	{
		a[i] = s1[la - i - 1] - '0';
	}
	for(int i = la - 1 ; i >= 0; i--)
	{
		t = t * 10 + a[i];
		c[i] = t / b;
		t = t % b;
	}
	while(c[lc-1] == 0 && lc > 1) lc--;
	for(int i = lc - 1 ; i >= 0; i--)
	{
		cout << c[i];
	}
	
	return 0;
} 
